import request from '@/utils/request'

export function getBankProductionsList(params) {
  return request({
    url: '/admin/product/bank',
    method: 'get',
    params
  })
}

export function getFastProductionsList(params) {
  return request({
    url: '/admin/product/fast',
    method: 'get',
    params
  })
}

export function addOneFastProduct(data) {
  return request({
    url: '/admin/product/fast',
    method: 'post',
    data
  })
}

export function updateOneFastProduct(data) {
  return request({
    url: '/admin/product/fast',
    method: 'put',
    data
  })
}

export function getFastProductByID(idObj) {
  const { id } = idObj
  return request({
    url: `/admin/product/fast/${id}`,
    method: 'get'
  })
}

export function deleteFastProductByIDs(data) {
  // data e.g. { product_ids: [] }
  return request({
    url: `/admin/product/fast`,
    method: 'delete',
    data
  })
}

export function addOneBankProduct(data) {
  return request({
    url: '/admin/product/bank',
    method: 'post',
    data
  })
}

export function updateOneBankProduct(data) {
  return request({
    url: '/admin/product/bank',
    method: 'put',
    data
  })
}

export function getBankProductByID(idObj) {
  const { id } = idObj
  return request({
    url: `/admin/product/bank/${id}`,
    method: 'get'
  })
}

export function deleteBankProductByIDs(data) {
  // data e.g. { product_ids: [] }
  return request({
    url: `/admin/product/bank`,
    method: 'delete',
    data
  })
}
